﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TemplateAdmin.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="AirlineProject.Models"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	addflight
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  <script src="../../../../Content/admin/js/jquery-1.4.2.js" type="text/javascript"></script>
    <script src="../../../../Content/admin/js/jquery-ui-1.8.2.custom.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        $('.mycalendar').datepicker({
            changeYear: true,
            changeMonth: true,
            dateFormat: 'yy-mm-dd',
            showAnim: 'fold',
            inline: true,
            yearRange: '2012:2020',
            onSelect: function (dateText, inst) {
                //for(var key in inst){
                //alert(key);
                //}
                alert(inst['currentYear'])
                // id, input, selectedDay, selectedMonth, selectedYear, drawMonth, drawYear, inline, currentDay, currentMonth, currentYear, 

                //alert($('.mycalendar').parent().parent().parent().parent().parent().find('.ui-datepicker-year option:selected').val());
            }
        });
    });
</script>

   <h3 id="adduser">Add Flight</h3>
   &nbsp;&nbsp;
   <fieldset id="personal">
   <% using (Html.BeginForm("handaddflight", "templateadmin", FormMethod.Post, new { id = "myform" }))
      { %> 
                    <%= ViewData["massage"] != null ? ViewData["massage"] : ""%>
                        <legend>INFORMATION</legend>
                        <label for="firstname">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Origin : </label>
                        <select class="keysearch" name="orgin_id" style="width:20">
                            <%         
                       
                        AccountModels tk = new AccountModels();
                        List<Orgin> dsto = tk.ListOrg();
                        foreach (Orgin from in dsto)
                         {  
                    %>         
                                <option value="<%= from.orgin_id %>"> <%= from.place_name%></option>
                                       
                    <% } %>
                    </select> 
                        <br />
                        <br />
                        <label for="email">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Destination : </label>
                        <select class="result" name="destination_id" style="width:20">
                      
                    <%
                            Destination des = new Destination();
                            des = (Destination)Session["des"]; 
                        AccountModels tkm = new AccountModels();
                        List<Destination> dsfrom = tkm.ListDes();
                        foreach (Destination to in dsfrom)
                         {  
                    %>
                                <option value="<%= to.destination_id %>"> <%= to.place_name %></option>     
                    <% } %>
                    </select> 
                        <br />    
                        <br />                
                        <label for="pass">Departure Date : </label>
                        <input name="departure_date" class="mycalendar" id="pass" type="text" 
                        tabindex="2" />
                        <br />
                        <br />
                        <label for="pass-2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Flight Price : </label>
                        <input name="flight_price" id="pass-2" type="text" 
                        tabindex="2" />
                        <br />
                        <br />
                        <label for="pass-2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Seat Num : </label>
                        <input name="seat_num" id="Password1" type="text" 
                        tabindex="2" />
                      </fieldset>
                      <div align="center">
                      <input id="button1" type="submit" value="Add" /> 
                      <input id="button2" type="reset" />
                      </div>
                      <% } %>
</asp:Content>
